/*
 * @Author: malgee
 * @Date: 2025-04-18 11:51:09
 * @LastEditors: maling
 * @LastEditTime: 2025-04-23 09:22:21
 * @FilePath: /vue3-ts-cms/src/service/request/type.ts
 * @Description:
 *
 */
import { AxiosRequestConfig, AxiosResponse } from 'axios'

export interface MGInterceptors {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  responseInterceptor?: (response: AxiosResponse) => AxiosResponse
  responseInterceptorCatch?: (error: any) => any
}

export interface MGRequestConfig extends AxiosRequestConfig {
  interceptors?: MGInterceptors
  showLoading?: boolean
}

export interface MGDataType<T = any> {
  data: T
  headers: any
  config: any
  request: any
  returnCode: any
  success: boolean
}
